"use strict";
cc._RF.push(module, '7af0f83rZpJ1pR4TGz6Rzf9', 'Rank');
// scripts/Rank.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("GlobalUserData"),
    s = t("Util"),
    l = cc._decorator,
    c = l.ccclass,
    d = l.property,
    h = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.powerNode = null, e.trophyNode = null, e.subContextView = null, e;
  }

  return n(e, t), e.prototype.onLoad = function () {
    this.setSubContextViewState(!1);
  }, e.prototype.start = function () {
    s.Util.sendMsgToOpendata("Trophy", r["default"].nTrophy), s.Util.showBanner(), s.Util.hideSingleCustomAd(), s.Util.show_VerticalCustomAd(!1), s.Util.show_VerticalCustomAd(!0), this.scheduleOnce(this.showTrophyRank, .5);
  }, e.prototype.showPowerRank = function () {
    var t = this;
    this.unscheduleAllCallbacks(), this.powerNode.active = !0, this.scheduleOnce(function () {
      t.trophyNode.active = !1;
    }, .5), s.Util.sendMsgToOpendata("Power", s.Util.getCurItemPower(r["default"].getCurCarPower())), this.showRanking("Power");
  }, e.prototype.showTrophyRank = function () {
    var t = this;
    this.unscheduleAllCallbacks(), this.scheduleOnce(function () {
      t.powerNode.active = !1;
    }, .5), this.trophyNode.active = !0, s.Util.sendMsgToOpendata("Trophy", r["default"].nTrophy), this.showRanking("Trophy");
  }, e.prototype.showRanking = function (t) {
    cc.log("显示排行榜asda");
    var e = Math.round(new Date().getTime() / 1e3),
        o = new Array();
    o.push(t);
    var i = window.wx || window.tt || window.swan,
        n = i && i.getOpenDataContext();
    n && n.postMessage({
      type: "GET",
      data: o,
      timer: e
    }), this.setSubContextViewState(!0);
  }, e.prototype.setSubContextViewState = function (t) {
    this.subContextView.enabled = t, this.subContextView.node.active = t, t && this.subContextView.updateSubContextViewport();
  }, e.prototype.close = function () {
    this.setSubContextViewState(!1), this.node.parent.destroy(), s.Util.hideBanner(), s.Util.showSingleCustomAd(), s.Util.hide_VerticalCustomAd(!1), s.Util.hide_VerticalCustomAd(!0);
  }, a([d(cc.Node)], e.prototype, "powerNode", void 0), a([d(cc.Node)], e.prototype, "trophyNode", void 0), a([d(cc.SubContextView)], e.prototype, "subContextView", void 0), a([c], e);
}(cc.Component);

o["default"] = h;

cc._RF.pop();